package com.HomeWork12.work2;

public class Player {
    String profession;
    int atkmax;
    int atkmin;
    int PlayerBlood;

    public Player() {

    }
    public void attack(Moster moster){
        //Moster dragon = new Dragon();
        System.out.println("玩家攻击："+moster.getName());
        int attack1 =  (int)(Math.random()*(this.atkmax-this.atkmin));
        System.out.println(this.profession +"本次产生的伤害值为:"+attack1);
        double mosterBlood =moster.getBlood();
        //System.out.println("当前龙的血量为"+DragonBlood1);
        mosterBlood=mosterBlood-attack1;
        System.out.println(moster.getName()+"的剩余血量："+mosterBlood);
        moster.setBlood(mosterBlood);



    }

    public Player(String profession, int atkmax, int atkmin, int playerBlood) {
        this.profession = profession;
        this.atkmax = atkmax;
        this.atkmin = atkmin;
        PlayerBlood = playerBlood;
    }

    public String getProfession() {
        return profession;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }

    public int getAtkmax() {
        return atkmax;
    }

    public void setAtkmax(int atkmax) {
        this.atkmax = atkmax;
    }

    public int getAtkmin() {
        return atkmin;
    }

    public void setAtkmin(int atkmin) {
        this.atkmin = atkmin;
    }

    public int getPlayerBlood() {
        return PlayerBlood;
    }

    public void setPlayerBlood(int playerBlood) {
        PlayerBlood = playerBlood;
    }

}
